﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Bids.Core.Infrastructure;
using Telerik.OpenAccess.Metadata;
using Telerik.OpenAccess.Metadata.Fluent;

namespace Bids.Core.DomainObjects
{
    /// <summary>
    /// 提现表
    /// </summary>
    [Serializable]
    public class WithdrawDeposit : IEntity
    {
        public WithdrawDeposit()
        {
            this.CreateTime = DateTime.Now;
        }
        /// <summary>
        /// 
        /// </summary>
        public virtual int ID { set; get; }
        /// <summary>
        /// 用户id
        /// </summary>
        public virtual int UserId { set; get; }

        /// <summary>
        /// 状态
        /// </summary>
        public virtual int State { set; get; }

        /// <summary>
        /// 产生时间
        /// </summary>
        public virtual DateTime CreateTime { set; get; }

        /// <summary>
        /// 提现金额
        /// </summary>
        public virtual int Amount { set; get; }

        /// <summary>
        /// 账号信息
        /// </summary>
        public virtual string CashInfo { set; get; }

        public virtual WPStatus WPStatu
        {
            get
            {
                return (DomainObjects.WPStatus)this.State;
            }
        }
        public static MappingConfiguration<WithdrawDeposit> CreateConfiguration()
        {
            var threadMapping = new MappingConfiguration<WithdrawDeposit>();
            threadMapping.MapType(t => new
            {
                t.ID,
                t.UserId,
                t.State,
                t.CreateTime,
                t.Amount,
                t.CashInfo
            }).ToTable("WithdrawDeposit");
            threadMapping.HasProperty(t => t.ID).IsIdentity(KeyGenerator.Autoinc);

            return threadMapping;
        }
        
    }
    public enum WPStatus
    {
        审核 = 1,
        完成 = 2,
        取消 = 3
    }
}
